﻿using IdentityServer4.Models;
using IdentityServer4.Services.InMemory;
using System.Collections.Generic;
using System.Security.Claims;

namespace IdentityserverWithAspNetIdentity {
    public class Config {
        public static IEnumerable<Scope> GetScopes() {
            return new List<Scope> {
                StandardScopes.OpenId,
                StandardScopes.Profile,
                StandardScopes.OfflineAccess,
                new Scope {
                    Name = "api1",
                    Description = "My API"
                }
            };
        }

        public static IEnumerable<Client> GetClients() {
            return new List<Client> {

                new Client {
                    ClientId = "hybrid",
                    ClientName = "Hybrid Client",
                    AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,

                    RequireConsent = false,

                    ClientSecrets = new List<Secret> {
                        new Secret("secret".Sha256())
                    },

                    RedirectUris = new List<string> {
                        "http://localhost:5002/signin-oidc"
                    },

                    PostLogoutRedirectUris = new List<string> {
                        "http://localhost:5002"
                    },

                    AllowedScopes = new List<string> {
                        StandardScopes.OpenId.Name,
                        StandardScopes.Profile.Name,
                        StandardScopes.OfflineAccess.Name,
                        "api1"
                    }
                }
            };
        }
    }
}
